import request from '../../../utils/request'

class DistributionInfoApi {
    queryByCond(data, pageSize, pageNum) {
        return request({
            url: `/distributionmain/queryByCond?pageSize=${pageSize}&pageNum=${pageNum}`,
            method: 'post',
            data
        })
    }
    getDistributionTree(data) {
        return request({
            url: '/distribution/getDistributionTree',
            method: 'get',
            params: data
        })
    }
    getDistributionDetail(data) {
        return request({
            url: '/distribution/getDistributionDetail',
            method: 'get',
            params: data
        })
    }

    delete(data) {
        return request({
            url: '/distributionmain/delete',
            method: 'post',
            data
        })
    }
    getPeerAndSubDeptsWithUsers() {
        return request({
            url: '/api/dept-user-tree/getPeerAndSubDeptsWithUsers',
            method: 'get',
        })
    }
    add(data) {
        return request({
            url: '/distribution/createDistribution',
            method: 'post',
            data
        })
    }
    receiveFile(data) {
        return request({
            url: '/distribution/receiveFile',
            method: 'post',
            data
        })
    }
    destroyFile(data) {
        return request({
            url: '/distribution/destroyFile',
            method: 'post',
            data: data
        })
    }
}

export default new DistributionInfoApi()
